package com.dy.design_pattern_study.the_facade_pattern.dome1;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-03-27
 * @Content 基金类
 */
public class Fund {

    NationalDebt1 nationalDebt1;
    Realty1 realty1;
    Stock1 stock1;
    Stock2 stock2;
    Stock3 stock3;

    public Fund() {
        nationalDebt1 = new NationalDebt1();
        realty1 = new Realty1();
        stock1 = new Stock1();
        stock2 = new Stock2();
        stock3 = new Stock3();
    }

    /**
     * 基金直接进行购买，用户不必知道买了什么
     */
    public void sellFund() {
        //买入
        nationalDebt1.buy();
        realty1.buy();
        stock1.buy();
        stock2.buy();
        stock3.buy();
    }

    /**
     * 基金直接进行抛售，用户不必知道售卖了什么
     */
    public void buyFund() {
        //抛售
        nationalDebt1.sell();
        realty1.sell();
        stock1.sell();
        stock2.sell();
        stock3.sell();
    }

}
